
<table class="table table-bordered table-list">
    <thead>
        <tr>
            <td>产品名称</td>
            <td class="text-right">价格</td>
            <td class="text-right">数量</td>
            <td class="text-right">小计</td>
        </tr>
    </thead>
    <tbody>

      <% carts.each do |cart| %>
      <% product = cart.product %>
      <tr>
          <td>
              <%= product_small_img product %>
              <span><%= product.title %></span>
          </td>
          <td class="text-right">￥<%= product.msrp %></td>
          <td class="text-right"><%= cart.amount %></td>
          <td class="text-right">￥<%= cart.amount * product.msrp %></td>
      </tr>
      <% end %>
      <tr>
          <td colspan="2"></td>
          <td class="text-right">
              <!--<div>运费：￥10.0</div>-->
              <div>应付总额：<span class="money">￥<%= carts.sum { |cart| cart.amount * cart.product.price } %></span></div>
          </td>
          <td>
              <%= form_tag orders_path, method: :post, class: "create-order-form", id: 'order_form' do %>
              <input type="hidden" name="address_id" value="" id="input_address_id"/>
              <input type="hidden" name="invoice_id" value="" id="input_invoice_id"/>
              <button class="btn btn-primary" type="submit">提交订单</button>
              <% end %>
          </td>
      </tr>
      </tbody>
</table>
